HatchShape AddEllipse2D

Adds an 2D Ellipse boundary to the HatchShape

Overloads

public void AddEllipse2D(f loat centerX, float centerY, float majorAxisLength, float majorAxisAngle, float ratioMinorMajor)
public void AddEllipse2D (float centerX, float centerY, float majorAxisLength, float majorAxisAngle, float ratioMinorMajor, float maximumSegmentationError)

 

Return value

void  

 

Parameters

float centerX The x coordinate of the center
float centerY The y coordinate of the center
float majorAxisLength Length of the major axis of the ellipse
float majorAxisAngle The major axis angle(measured in radians) of the ellipse
float ratioMinorMajor The ratio of minor axis to major axis of the ellipse
float maximumSegmentationError measures how much a curve deviates from a straight line segment between two points on the curve.

 

Example

Copy
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);

if (scanDocument != null)
{
    VectorImage vectorImage = scanDocument.CreateVectorImage("image1", DistanceUnit.Millimeters);

    vectorImage.SetMarkSpeed(1000);
    vectorImage.SetJumpSpeed(2000);
    vectorImage.SetJumpDelay(100);
    vectorImage.SetMarkDelay(100);

    //Set Laser Delays
    vectorImage.SetLaserOnDelay(10);
    vectorImage.SetLaserOffDelay(10);

    vectorImage.AddEllipse(0, 0, 0, 10, 5, 3);

    HatchShape hatchShape = new HatchShape();
    hatchShape.AddEllipse2D(0, 0, 10, 5, 3); 

    hatchShape.AddHatchPatternLine(1, HatchLineBorderGapDirection.Inward, 0.05f,
                   0, 0, 0, HatchLineStyle.Serpentine, true,
                   HatchOffsetAlgorithm.DirectOffset, HatchCornerStyle.Sharp);

    vectorImage.AddHatch(hatchShape, 0);


    scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));

    try
    {
        scanDocument.StartScanning();
    }
    catch (Exception exp)
    {
        MessageBox.Show(exp.Message);
    }
}